<%@ page language="java" import="java.util.*"  contentType="text/html; charset=UTF-8"%>
<%@ page import="crm.util.ParamUtil" %>
<%@ page import="crm.model.Schedule" %>
<%@ page import="crm.control.ScheduleControl"%>
<%@ page import="crm.control.EmployeesControl" %>
<%@page import="java.util.*"%>
<%@page import="crm.control.CustomerControl"%>
<%@page import="crm.control.EmployeesControl"%>
<%@page import="crm.model.Employees"%>
<%@page import="crm.model.Week_sum"%>
<%@page import="crm.control.WeeksumControl" %>
<%@page import="crm.model.Week_plan"%>
<%@page import="crm.control.WeekplanControl"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>天成科技CRM管理系统</title>
<!--                       CSS                       -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="../../../resources/css/reset.css" type="text/css" media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="../../../resources/css/style.css" type="text/css" media="screen" />
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
<link rel="stylesheet" href="../../../resources/css/invalid.css" type="text/css" media="screen" />
<!--                       Javascripts                       -->
<!-- jQuery -->
<script type="text/javascript" src="../../../resources/js/jquery-1.2.6.js"></script>
<!-- jQuery Configuration -->
<script type="text/javascript" src="../../../resources/scripts/simpla.jquery.configuration.js"></script>
 <script type="text/javascript" src="../../../resources/js/WebCalendar.js"></script>
<!-- Facebox jQuery Plugin -->
<script type="text/javascript" src="../../../resources/scripts/facebox.js"></script>
<!-- jQuery WYSIWYG Plugin -->
<script type="text/javascript" src="../../../resources/scripts/jquery.wysiwyg.js"></script>
<!-- jQuery Datepicker Plugin -->
<script type="text/javascript" src="../../../resources/scripts/jquery.datePicker.js"></script>
<script type="text/javascript" src="../../../resources/scripts/jquery.date.js"></script>
<script type="text/javascript" src="../../../resources/js/reinitIframe.js"></script>
<script type='text/javascript'>	
<script type='text/javascript'>
$(function(){
		$('#add').css('cursor','pointer')
		.click(function(){
			var tem = $('.model').eq(0).clone();
			$('tbody').append(tem);
			$("tr:even").addClass('odd');
		});
		$('#del').css('cursor','pointer')
		.click(function(){
			alert('')
			alert($('.tb tr').last())
			$('.tb tr').last().remove();
		});
		setInterval(function(){
		new ReinitIframe('iinformation');
		},200);
});
</script>
<style type="text/css">
.hide{
    position: absolute;
    zoom: 0.001;
    -moz-transform: scale(0);
    -webkit-transform: scale(0);
    -o-transform: scale(0);
    transform: scale(0);
}
#main-content #summay{margin:0 auto;}
#main-content #summay .title{ background:#9bbb59; height:40px;margin:2px auto;line-height:40px; text-align:center;}			
#main-content #summay tr td,#main-content #summay thead th{border:1px solid #9bbb59; text-align:center;}
#main-content #summay thead th,#main-content #summay .odd{background:#d7e3bc; ! important}
#main-content #summay .time{ border-top:0;border-left:0; border-right:0;border-bottom:1px solid #9bbb59; }
#main-content #summay .bi{background:inherit;}
#main-content #summay .input{ border:0;height:78px; padding:0 2px; margin:2px auto; background:inherit;}


</style>
</head> 
  <body>
  <%
  	 request.setCharacterEncoding("utf-8");
      Employees cu = (Employees)session.getAttribute("user");
   %>
  <div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">天成科技CRM管理系统</a></h1>
      <!-- Logo (221px wide) -->
      <a href="#"><img id="logo" src="../../../resources/css/slice/notice.png" alt="Simpla Admin logo" /></a>
      <!-- Sidebar Profile links -->
      <div id="profile-links"> <a href="#"><%=EmployeesControl.getEmployeesName(cu.getId())%>,您好！</a> <br />
        <br />
        <a href="#information" rel='modal' >修改个人信息</a> | <a href="../../login/logout.jsp" title="Sign Out">注销</a> </div>
      <ul id="main-nav">
        <!-- Accordion Menu -->
        <li> <a href="#" class="nav-top-item">公司页面 </a>
          <ul>
	          <li><a href='../company/material/material_download.jsp'>资料 </a></li>
	          <li><a href='../company/notice/notice.jsp'>公告</a></li>
	          <li><a href='../company/salearea/salearea.jsp'>销售区域</a></li>
	          <li><a href='../company/saletarget/saletarget.jsp'>销售目标</a></li>
          </ul>
         </li>
        <li> <a href="../recepit/show_all_recepits.jsp" class="nav-top-item no-submenu">
          <!-- Add the class "current" to current menu item -->
           我的跟单</a>
        
        </li>
        <li> <a href="../offer/show_all_offers.jsp" class="nav-top-item no-submenu">报<span class='letter'>价</span></a>      
        </li>
        <li> <a href="../bargain/show_all_bargains.jsp" class="nav-top-item no-submenu">合<span class='letter'>同</span></a>
        </li>
        <li> <a href="#" class="nav-top-item current">日<span class='letter'>程</span></a>
        	<ul>
	        	<li><a href='../schedule/schedule.jsp'>日程管理</a></li>
	        	<li><a  href='../schedule/all_sum.jsp'>周总结</a></li>
	        	<li><a class='current' href='../schedule/all_plan.jsp'>周计划</a></li>
        	</ul>
        </li>
        <li> <a href="../customer/customer.jsp" class="nav-top-item no-submenu">我的客户</a>
        <%
            if(cu.getPosition()!=1){
            	%>
            	<li> <a href="#" class="nav-top-item">统<span class='letter'>计</span></a>
		          <ul>
		            <li><a href="../../control/statistics/company_statistics.jsp">公司统计</a></li>
		            <li><a href="../../control/statistics/employees_statistics.jsp">员工统计</a></li>
		          </ul>
		        </li>
            	<li><a href="../employees/employees.jsp" class="nav-top-item no-submenu">员工管理</a></li>
            	<%
            }
        %>
        </li>
      </ul>
    </div>
  </div>
  <%
          request.setCharacterEncoding("UTF-8");
          Week_plan weekPlan = new Week_plan();
          int id = ParamUtil.getInt(request,"id");
          session.setAttribute("all_plan_id",id);
   %>
  <div id="main-content">
  	  <form action="w_plan_update_do.jsp" method='post'>
	 <div class="content-box-header">
	 <h3 style="cursor: s-resize;">周计划</h3>
	 </div>
	<form >
	<table id='summay'>
		<thead>
		 <tr>
			<th height='40'>时间</th>
			<th>内容</th>
			<th>协助人</th>
			<th>备注</th>
		</tr>
		</thead>
		<tbody class='tb'>
		<%
		      
		      Collection weekplan = new ArrayList();
		      weekplan = WeekplanControl.getAllWeepPlans(id);
		      Iterator iterator = weekplan.iterator();
		      int i=0;

		      while(iterator.hasNext()){
		      i++;
		      Week_plan w = (Week_plan)iterator.next();
		      session.setAttribute("week_plan",w);
		 %>
		<tr class='model'>
			<td height='60'><input class='time bi' name="time<%=i %>" type='text' value="<%=w.getDate() %>"/></td>
			<td><textarea class='input' name="content<%=i %>"><%=w.getContent() %></textarea></td>
			<td><textarea class='input' name="help_person<%=i %>"><%=w.getHelp_person() %></textarea></td>
			<td><textarea class='input' name="description<%=i %>"><%=w.getDescription() %></textarea></td>
		    <input type="hidden" value="<%=w.getId() %>" name="id<%=i %>"/>
		</tr>
		<%}while(i<7){ 
		   i++;
		   Week_plan weekPlan2 = (Week_plan) session.getAttribute("week_plan");
		   %>
		     <tr class='model'>
			<td height='60'><input class='time bi' name="time<%=i %>" type='text' value=""/></td>
			<td><textarea class='input' name="content<%=i %>"></textarea></td>
			<td><textarea class='input' name="help_person<%=i %>"></textarea></td>
			<td><textarea class='input' name="description<%=i %>"></textarea></td>
		    <input type="hidden" value="<%=weekPlan2.getId() %>" name="id<%=i %>"/>
		</tr>  
		<%} %>
		</tbody>
		<tfoot>
			<tr style='background:#fff;'>
				<td colspan='4' height='40'>
					<input class='button' type='reset' value='重置'/>&nbsp;&nbsp;&nbsp;&nbsp;
					<input class='button' type='submit' value='提交'/>
				</td>
			</tr>
		</tfoot>
	</table>
	</form>
	</form>
	</div>
	</div>
	</body>
</html>
